/**
 * @version 1.0
 * @created 02 December 2010
 *
 * CheckoutService
 *
 * Copyright @ 2010 by CES
 * All Rights Reserved.
 * CES CONFIDENTIAL AND TRADE SECRET
 * 
 */
package com.ces.knacky.services;

import java.util.List;

import com.ces.knacky.framework.exception.DataAccessException;
import com.ces.knacky.framework.model.IEntity;
import com.ces.knacky.framework.services.CommonService;


/**
 * Checkout Service is used for both direct purchase and bid workflow case. 
 * 
 * @author bipul_sinha
 *
 */
public interface CheckoutService extends CommonService {
	/**
	 * It is used to place order for the selected items whose ids are given.
	 *  
	 * @param 	itemIds
	 * 			Represents persistent ids of Item table for whom the order needs to be placed.
	 * @return	Integer
	 * 			Persistent Id of the saved object in the database.
	 */
	Integer placeOrder(String itemIds);
	
	/**
	 * It is used to fetch list of items whose order has been placed by the user.
	 *   
	 * @param 	username
	 * 			Represents name of the user who has placed order.
	 * @param 	orderId
	 * 			Order persistent identifier whose order item needs to be fetched.
	 * @return	List<IEntity>
	 * 			Returns list of items whose order is placed.
	 */
	List<? extends IEntity> fetchPlacedOrder(String username, Integer orderId);
	
	/**
	 * This methods checks the availability of the order items.
	 * @param orderId - persistent id of the order for which item availability is to be checked.
	 * @return - true , if items are available ,false otherwise
	 * @throws DataAccessException 
	 */
	boolean isOrderItemAvailable(int orderId) throws DataAccessException;
}